﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities.PBKT;
using Entities.Admin;

namespace BLL.PBKT
{
	public class Arbitration
	{
		public static void AddTrongTai(LichThiDau ltd, string tt)
		{
			string[] s = tt.Split('-');

			QLTranDau cttd = new QLTranDau();
			//cttd.MaLichThiDau = "LTD_00012";
			cttd.MaLichThiDau = ltd.MaLichThiDau;
			cttd.MaNguoiTG = s[0];
			cttd.HinhThuc = s[1] == "Bắt chính" ? 1 : 2;
			
			QLTranDau.Objects.InsertOrUpdate(cttd);

		}
		public static bool Exit(TrongTai trongTai)
		{
			List<QLTranDau> dsQlTranDau = null;
			dsQlTranDau = QLTranDau.Objects.Find(c => c.MaNguoiTG == trongTai.MaTT).ToList();
			if (dsQlTranDau != null)
				return true;
			return false;
		}
		
	}
}
